/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.delivery.dto;

import com.mycompany.delivery.validation.DeliveryDTOConstraint;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *
 * @author Jana Nemcova
 */

public class DeliveryDTO implements Serializable, Cloneable{
     
    private static final long serialVersionUID = 1L;
  
    private Long id;

    private DTOState state;
   
    private ContactDTO sender;
 
    private ContactDTO receiver;
    
    private Date sendingDate;
    
    private Date deliveryDate;
  
    //private List<String> goods = new ArrayList<String>();
    
    private String notes;
    
    private double price;
    
    private boolean paid;

   private Long employee;

   private Long courier;

    
    
     public DeliveryDTO(DTOState state, ContactDTO sender, ContactDTO receiver, Date sendingDate, Date deliveryDate, String notes, double price, boolean paid, Long employee, Long courier) {
        this.state = state;
        this.sender = sender;
        this.receiver = receiver;
        this.sendingDate = sendingDate;
        this.deliveryDate = deliveryDate;
        this.notes = notes;
        this.price = price;
        this.paid = paid;
        this.employee = employee;
       this.courier = courier;
    }
     
    
    public DeliveryDTO() {
        
    }

    public void setId(Long id) {
        this.id = id;
    }
    
    public Long getId() {
        return id;
    }


    public DTOState getState() {
        return state;
    }

    public void setState(DTOState state) {
        this.state = state;
    }

  

    public Date getSendingDate() {
        return sendingDate;
    }

    public void setSendingDate(Date sendingDate) {
        this.sendingDate = sendingDate;
    }

    public Date getDeliveryDate() {
        return deliveryDate;
    }

    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }

    /*public List<String> getGoods() {
        return goods;
    }

    public void setGoods(List<String> goods) {
        this.goods = goods;
    }
    
    public void addGoods(String goods) {
        this.goods.add(goods);
    }
    
    public void removeGoods(String goods) {
        this.goods.remove(goods);
    }*/

    
      public Long getEmployee() {
        return employee;
    }

    public void setEmployee(Long employee) {
        this.employee = employee;
    }

    public Long getCourier() {
        return courier;
    }

    public void setCourier(Long courier) {
        this.courier = courier;
    }
    
    public ContactDTO getSender() {
        return sender;
    }

    public void setSender(ContactDTO sender) {
        this.sender = sender;
    }

 public ContactDTO getReceiver() {
        return receiver;
    }

    public void setReceiver(ContactDTO receiver) {
        this.receiver = receiver;
    }
    
    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public boolean isPaid() {
        return paid;
    }

    public void setPaid(boolean paid) {
        this.paid = paid;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 29 * hash + (int) (this.id ^ (this.id >>> 32));
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DeliveryDTO other = (DeliveryDTO) obj;
        if (this.id != other.id) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Delivery{" + "id=" + id + ", state=" + state + ", sender=" + sender + ", receiver=" + receiver + ", sendingDate="
                + sendingDate + ", deliveryDate=" + deliveryDate + ", goods=" + /*goods +*/ ", notes=" + notes + ", price=" + price + 
                ", paid=" + paid + '}';
    }
  
}
